package cn.stylefeng.guns.modular.commodity.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


/**
 * @author allen
 * @date 2021/4/11 17:59
 * @version 1.0
 */

/**
 * 商品属性值
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "commodity_goods_property_value")
public class CommodityGoodsPropertyValueEntity implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 属性值的类型，1：类目直接关联的属性的值；2：类目的属性组关联的属性的值
     */
    @TableField(value = "`type`")
    private Integer type;

    /**
     * 商品ID
     */
    @TableField(value = "goods_id")
    private Long goodsId;

    /**
     * 如果type是1，那么这里是类目与属性关联关系的ID；如果type是2，那么这里是类目的属性组与属性的关联关系的id
     */
    @TableField(value = "relation_id")
    private Long relationId;

    /**
     * 如果是可选的，那么直可能就是：黑色,白色，多个值串起来的；如果是输入的，那么就是直接输入的一个值
     */
    @TableField(value = "property_value")
    private String propertyValue;

    /**
     * 创建时间
     */
    @TableField(value = "gmt_create")
    private Date gmtCreate;

    /**
     * 更新时间
     */
    @TableField(value = "gmt_modified")
    private Date gmtModified;

    private static final long serialVersionUID = 1L;

    public static final String COL_ID = "id";

    public static final String COL_TYPE = "type";

    public static final String COL_GOODS_ID = "goods_id";

    public static final String COL_RELATION_ID = "relation_id";

    public static final String COL_PROPERTY_VALUE = "property_value";

    public static final String COL_GMT_CREATE = "gmt_create";

    public static final String COL_GMT_MODIFIED = "gmt_modified";
}